function getObj(id) {
  return YAHOO.util.Dom.get(id);
}

function getChildById(node, id) {

  function idTest(child_node) {
    return child_node.id == id;
  }

  return YAHOO.util.Dom.getElementBy(idTest, null, node);
}

function getChildByName(node, name) {

  function nameTest(child_node) {
    return child_node.name == name;
  }

  return YAHOO.util.Dom.getElementBy(nameTest, null, node);
}

function errorBlink() {
  var indicator = getObj("hcp-error-indicator");
  if (indicator) {
    var color = "#ffaaaa";

    var animCount = 0;
    var anim = new YAHOO.util.ColorAnim(indicator, {backgroundColor: { to: color } });
    anim.onComplete.subscribe(function() {
      animCount++;
      if (animCount < 8) {
        this.attributes.backgroundColor.to = (this.attributes.backgroundColor.to == "#ffffff") ? color : "#ffffff";
        this.animate();
      }
    });

    anim.animate();
  }
}

YAHOO.util.Event.onDOMReady(errorBlink);
